package com.local.seckill.feign;

import com.local.common.util.ResultUtil;
import com.local.seckill.pojo.Seckill;
import com.local.seckill.pojo.SeckillListRequestParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient("seckillservice")
public interface SeckillServiceFeign {

    @GetMapping("/seckill/list")
    @ResponseBody
    public ResultUtil seckillList(@RequestBody SeckillListRequestParam requestParam);

    /**
     * 根据id查找数据
     * @param seckillId
     * @return
     */
    @GetMapping("/seckill/{seckillId}")
    @ResponseBody
    public ResultUtil getSeckillById(@PathVariable("seckillId") Integer seckillId);

    /**
     * 新增
     * @param seckill
     * @return
     */
    @PostMapping("/seckill/save")
    @ResponseBody
    public ResultUtil seckillSave(@RequestBody Seckill seckill);

    /**
     * 修改
     * @param seckill
     * @return
     */
    @PostMapping("/seckill/update")
    @ResponseBody
    public ResultUtil seckillUpdate(@RequestBody Seckill seckill);

    /**
     * 根据id逻辑删除
     * @param seckillId
     * @return
     */
    @DeleteMapping("/seckill/{seckillId}")
    @ResponseBody
    public ResultUtil seckillDelete(@PathVariable("seckillId") Integer seckillId);
}
